{literal}
<script language="javascript" src="js/contact_us.js"></script>
   

<script language="javascript">
var $ = jQuery.noConflict();

function CheckFields()
{
   /*if($("#rate").isEmpty())
    	 $("#rate").attr('style','border:1px solid #FF0000');*/
   if(document.getElementById('user_type').value==1)	{ 		 	 		 		 		 		 
	  if(!$("#paypal_email_id").emailCheck() || document.getElementById('paypal_email_id').value=='' ) 
	   {
		$('#FormErrorMsg').show();
		$('#FormErrorMsg').html("Please Enter a Valid paypal email");
		return false;
	   }
   }
  if(document.getElementById('user_type').value==2)	{ 		 	 		 		 		 		 
	  if(document.getElementById('rate').value=='' ) 
	   {
		
		$('#FormErrorMsg').show();
		$('#FormErrorMsg').html("Please Enter a Valid budget");
	
		return false;
	   }
  }
  if(document.getElementById('name').value=='')
   {
    $('#FormErrorMsg').show();
    $('#FormErrorMsg').html("Please enter your name");
	//$('#FormErrorMsg').fadeOut(2000);
    return false;
   }
  
   if(document.getElementById('city').value=='')
   {
    $('#FormErrorMsg').show();
    $('#FormErrorMsg').html("Please enter city");
	//$('#FormErrorMsg').fadeOut(2000);
    return false;
   }     
  
   if(document.getElementById('avail_L') && document.getElementById('avail_L').checked == true)
   {
      if(document.getElementById('availability_city').value=='')
	  {
	    $('#FormErrorMsg').show();
		$('#FormErrorMag').html("Please enter city");
		$('#availability_city').attr('style','border:1px solid #FF0000');
		return false; 
	  }	
	 
   }	
   if(document.getElementById('is_coach').value==1)
   {
        if(!$("#paypal_email_id").emailCheck() || document.getElementById('paypal_email_id').value=='' ) 
		   {
				$('#FormErrorMsg').show();
				$('#FormErrorMsg').html("Please Enter a Valid paypal email");
				$("#paypal_email_id").attr('style','border:1px solid #FF0000');
				return false;
		   }
     
   }
   if($('#Upload').val()!='')
  {
    //check it's extension
	 var status1,status2,status3,status4;
	 var str = $('#Upload').val();
	 str = str.toLowerCase(); 
	 status1 = str.indexOf('.jpg'); 
	 status2 = str.indexOf('.jpeg'); 
	 status3 = str.indexOf('.gif'); 
	 status4 = str.indexOf('.png'); 
    if(status1== -1 && status2== -1 && status3== -1 && status4== -1 ) 
	{
		$('#FormErrorMsg').show();
		$('#FormErrorMsg').html("* Wrong Image Format.");
		//$('#FormkErrorMsg').fadeOut(3000);
		$('#Upload').val('');
		return false;
    }
	//Check Image Size
	
  }
  document.getElementById("editprofileForm").submit();
  //return true;
 
}
function showhide_div()
{
	var chk = document.getElementById('avail_L').checked == true
	if(document.getElementById('avail_L').checked == true)
	{  
	  $('#avail_city').show();
	  $('#availability_city').show();
	 
	}
	if(document.getElementById('avail_L').checked == false)
	{  		
	  $('#avail_city').hide();
	  $('#availability_city').hide();
	}  			
} 
function keyCheck(eventObj, obj)
{
    var keyCode
 
    // Check For Browser Type
    if (document.all){
        keyCode=eventObj.keyCode
    }
    else{
        keyCode=eventObj.which
    }
  //alert(keyCode)
    var str=obj.value
 
    if(keyCode==46){
        if (str.indexOf(".")>0){
            return false
        }
    }
 
    if((keyCode<46 || keyCode >57)   &&   (keyCode >31)){ // Allow only integers and decimal points
        return false
    }
    
    return true
}


function limitText(limitField, limitCount, limitNum) {
	if (limitField.value.length > limitNum) {
		limitField.value = limitField.value.substring(0, limitNum);
	} else {
		limitCount.value = limitNum - limitField.value.length;
	}
}


   
</script>

{/literal}
<div align="right">
	{if $is_coach eq '0'}
	<!--label>Become a Coach :</label> <input type="radio" name="user_type" value="1" onclick="coach_game()" /-->
	<a class="button" href="coach_game_update.php?profile=Y"><span>Become a Coach</span></a>
	{/if}
	{if $is_partner eq '0'}
	<a class="button" href="training_partner_game_update.php?profile=Y">Become Training Partner</a>
	<!--label>Become a Training Partner :</label> <input type="radio" name="user_type" value="3" onclick="tp_game()"/-->
	{/if} 
</div>
<div class="content">
   	<!-- tab -->
    <ul class="tabflex">
       	<li><a href="schedule.php"><span>Schedule</span></a></li>
        <li><a href="inbox.php"><span>Message</span></a></li>
		<li><a href="profile.php" class="active"><span>Profile</span></a></li>
		{if $is_coach eq '1'}<li><a href="coach_game.php"><span>Coach</span></a></li>{/if}
		{if $is_partner eq '1'}<li><a href="training_partner_game.php"><span>Training Partner</span></a></li>{/if}
		<li><a href="cashier.php"><span>Cashier</a></li>
         
        </ul>
        <!-- tab -->
        <div class="clear"></div>
        <div class="tabular-content"> 
		<div class="total-message">&nbsp;&nbsp;</div>
		<div class="clear"></div>                     
        <div>
		<div class="register" style="margin-top: 20px">
		<div id='FormErrorMsg' style="color:red; text-align:center; padding-bottom:10px;">{if $ermsg neq ''} {$ermsg}{/if} </div>
		<form name="editprofileForm" id="editprofileForm" enctype="multipart/form-data" method='post'>
			<input type="hidden" name="oldphoto" value="{$Formval.photo}">
			<input type="hidden" name="is_coach" id="is_coach" value="{$is_coach}" />
			<input type="hidden" name="is_partner" id="is_partner" value="{$is_partner}" />
			<input type="hidden" name="submitForm" value="submitForm" />
			<fieldset>
				<label>User ID :</label>
				<input name="name" id="name" type="text" value="{$Formval.name}" class="con-req" />
				<input type="hidden" name="user_type" id="user_type" value="{$user_type}" />
				
				<p class="clear"></p>
				
				{if $Formval.photo neq ''}<label>&nbsp; </label><img src="uploaded/user_images/thumbs/small_{$Formval.photo}">
				<p class="clear"></p>
				<br />
				{/if}
				<label>Photo :</label>
				<input type="file" name="upload" id="Upload" accept="image/gif,image/jpeg,image/x-png" />
				&nbsp;&nbsp;
				
				
				<p class="clear"></p>
				
				<label>City :</label><div class="ausu-suggest">
				<input name="city" id="city" type="text" value="{$Formval.city_name}" class="con-req" autocomplete="off"/>
				<input name="cityid" id="cityid" type="hidden"  value="{$Formval.city}" autocomplete="off" />
				</div>
				<p class="clear"></p>
<!-- 				<label>Skype Id :</label> -->
<!-- 				<input name="skype_id" id="skype_id" type="text" value="{$Formval.skype_id}" /> -->
				<label>Language :</label>
				<select id="s2" multiple="multiple" name="language[]" class="selectbox" style="height: 120px">
				{section name=lang loop=$langArr}
				 <option value="{$langArr[lang].language_id}" {if in_array($langArr[lang].language_id,$language_ids)} selected="selected" {/if}>{$langArr[lang].language_name}</option>
				{/section}
				</select>
			   
				<p class="clear"></p>
				{if $is_coach eq '1' || $is_partner eq '1'}
				 <label>Availability :</label>
				 <input type="checkbox" name="availability_type1" class='check' value="O" {if $Formval.availability_type1 eq 'O'} checked="checked"{/if} />
				 <label class='chklabel'>Online</label>
				 <input type="checkbox" name="availability_type2" class='check' id="avail_L" onclick="showhide_div()" value="L" {if $Formval.availability_type2 eq 'L'} 
				 checked="checked"{/if} /><label class='chklabel'>Local</label>
				<p class="clear"></p>
				
				<label id="avail_city" {if $Formval.availability_type2 =='L'} {else} style='display:none' {/if}>Availability City :</label>
				<div class="ausu-suggest">
				<input name="availability_city" id="availability_city" type="text" value="{$Formval.availabilitycity_name}" class="con-req" 
				{if $Formval.availability_type2 =='L'} {else} style='display:none' {/if}/>
				<input name="acityid" id="acityid" type="hidden"  value="{$Formval.availability_city}" autocomplete="off" />
				</div>
				
				
				<p class="clear"></p>
				{/if}
				{if $is_coach eq '1'}
				<label>Paypal Email ID :</label>
				<input name="paypal_email_id" id="paypal_email_id" type="text" value="{$Formval.paypal_email_id}" class="con-req" />
				<p class="clear"></p>
				{/if}
				{if $is_coach eq '1' || $is_partner eq '1'}
				<label>About Me :</label>
					<textarea  name="description" id="description" onKeyDown="limitText(this.form.description,this.form.countdown,300);"
					onKeyUp="limitText(this.form.description,this.form.countdown,300);">{$Formval.description}</textarea>
					<p class="clear"></p>
					<label>Characters left </label><input readonly type="text" name="countdown" size="3" value="{$Formval.char_left}" class="tiny">
					<label></label>(Maximum characters: 300)
					<p class="clear"></p>
				{/if}
				<p class="clear"></p>
				<label>&nbsp;</label>
				<!--<input name="submit" class="submit" value="Update" type="submit" onclick='return CheckFields()' />-->
				<a class="button" href="#" style="" onclick="return CheckFields()">Update</a>
				<a class="button" href="profile.php" style="" onclick="">Cancel</a>
				<!--<input name="" class="cancel" value="Cancel" type="button" onclick="window.location.href='profile.php'" />-->
			
			</fieldset>
		</form>
      </div>
	  {literal}
       <script type="text/javascript">
        
            //$("#s2").dropdownchecklist({ width: 150 });
            //$("#s4").dropdownchecklist({ maxDropHeight: 120 });
             <!-- AUTOCOMPLETE -->
			 $.fn.autosugguest({  
				   className: 'ausu-suggest',
				  methodType: 'POST',
					minChars: 2,
					  rtnIDs: true,
					dataFile: 'autocomplete.php?action=populateCity'
			});
        
    </script>
	{/literal}
     <iframe width=132 height=142 name="gToday:contrast:agenda.js" id="gToday:contrast:agenda.js" src="sitemanager/DateRange/ipopeng.htm" scrolling="no" frameborder="0" style="visibility:visible; z-index:999; position:absolute; left:-300px; top:0px;"></iframe>  
      
     </div>
     </div>
    </div>